There has been known a distance measuring device using a time-of-flight (TOF) method. In this device, an object to be measured is irradiated with pulsed light from a light source, and scattered light that has been scattered by the object to be measured is detected by a photodetector. A reciprocation time of light becomes longer as a distance from the distance measuring device to the object to be measured, or an optical path length, becomes longer. Accordingly, it is possible to measure the distance by using a time difference between timing in which the light source emits the light and timing in which the scattered light is detected. Furthermore, by scanning the object to be measured with the pulsed light and measuring the distance to each of positions on the object to be measured, it is possible to generate a range image of the object to be measured.
Since intensity of the scattered light varies according to the distance and a type of the object to be measured (reflectance), an amount of variation thereof is relatively large. Accordingly, a dynamic range of the photodetector, which detects the scattered light, may be insufficient in some cases. In such cases, a range-finding error may occur.